import request from '@/utils/request'
//部门列表
export function department(data) {
    return request({
      url: 'department',
      method: 'get',
      params: data,
      headers: {
        showLoading: true
      }
    })
  }
//用户
export function userList(data) {
    return request({
      url: 'user',
      method: 'get',
      params: data,
      headers: {
        showLoading: true
      }
    })
  }
//部门选项
export function departmentOption(data) {
    return request({
      url: 'department/option',
      method: 'get',
      params: data,
      headers: {
        showLoading: false
      }
    })
  }
//用户选项
export function userRoleOption(data) {
    return request({
      url: 'user/role/option',
      method: 'get',
      params: data,
      headers: {
        showLoading: false
      }
    })
  }
//部门创建
export function departmentCreate(data) {
    return request({
      url: 'department/create',
      method: 'post',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//用户创建
export function userCreate(data) {
    return request({
      url: 'user/create',
      method: 'post',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//部门详情
export function departmentRead(data) {
    return request({
      url: 'department/read',
      method: 'get',
      params: data,
      headers:{
        'showLoading':true,
        'loadingTarget':'.innerLoding'
      }
    })
  }
//用户详情
export function userRead(data) {
    return request({
      url: 'user/read',
      method: 'get',
      params: data,
      headers:{
        'showLoading':true,
        'loadingTarget':'.innerLoding'
      }
    })
  }
//部门编辑
export function departmentUpdate(data) {
    return request({
      url: 'department/update',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//用户编辑
export function userUpdate(data) {
    return request({
      url: 'user/update',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//部门删除
export function departmentDelete(data) {
    return request({
      url: 'department/delete',
      method: 'delete',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//用户删除
export function userDelete(data) {
    return request({
      url: 'user/delete',
      method: 'delete',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//发现刷新
export function departmentUpdatestatus(data) {
    return request({
      url: 'department/updatestatus',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//用户刷新
export function userUpdatestatus(data) {
    return request({
      url: 'user/updatestatus',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//职务列表
export function userRoleList(data) {
    return request({
      url: 'user/role',
      method: 'get',
      params:data,
      headers: {
        showLoading: true
      }
    })
  }
//职务切换状态
export function userRoleUpdatestatus(data) {
    return request({
      url: 'user/role/updatestatus',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//职务启用
export function userRuleUpdatestatus(data) {
    return request({
      url: 'user/rule/updatestatus',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//职务切换状态
export function userRuleUpdateIsShow(data) {
    return request({
      url: 'user/rule/updateIsShow',
      method: 'put',
      data,
      headers: {
        showLoading: false
      }
    })
  }
//职务删除
export function userRoleDelete(data) {
    return request({
      url: 'user/role/delete',
      method: 'delete',
      data,
      headers: {
        showLoading: false
      }
    })
  }

//职务详情
export function userRoleRead(data) {
  return request({
    url: 'user/role/read',
    method: 'get',
    params: data,
    headers:{
      'showLoading':false,
    }
  })
}
//职务创建
export function userRoleCreate(data) {
  return request({
    url: 'user/role/create',
    method: 'post',
    data,
    headers: {
      showLoading: false
    }
  })
}
//职务编辑
export function userRoleupdate(data) {
  return request({
    url: 'user/role/update',
    method: 'put',
    data,
    headers: {
      showLoading: false
    }
  })
}
//数据权限
export function userRoleSettingdata(data) {
  return request({
    url: 'user/role/settingdata',
    method: 'put',
    data,
    headers: {
      showLoading: false
    }
  })
}
//权限列表
export function userRuleList(data) {
  return request({
    url: 'user/rule',
    method: 'get',
    params:data,
    headers: {
      showLoading: true
    }
  })
}
//权限下拉
export function userRuleOption(data) {
  return request({
    url: 'user/rule/option',
    method: 'get',
    params:data,
    headers:{
      'showLoading':false,
    }
  })
}
//权限新增
export function userRuleRreate(data) {
  return request({
    url: 'user/rule/create',
    method: 'post',
    data,
    headers: {
      showLoading: false
    }
  })
}
//权限编辑
export function userRuleUpdate(data) {
  return request({
    url: 'user/rule/update',
    method: 'put',
    data,
    headers: {
      showLoading: false
    }
  })
}
//权限编辑详情
export function userRuleRead(data) {
  return request({
    url: 'user/rule/read',
    method: 'get',
    params:data,
    headers:{
      'showLoading':true,
      'loadingTarget':'.innerLoding'
    }
  })
}
//权限设置
export function userRoleSetting(data) {
  return request({
    url: 'user/role/setting',
    method: 'put',
    data,
    headers: {
      showLoading: false
    }
  })
}



